<template>
  <div>
    <a-card>
      <a-row style="margin-bottom: 10px">
        <a-col :span="24"  style="display: flex;flex-direction: row-reverse">
          <a-button v-print="'#printReport'" type="primary">打印报表</a-button>
        </a-col>
      </a-row>
      <div id="printReport">
        <div style="width: 100%;font-size: 20px;text-align: center">MES</div>
        <table border="1" cellpadding="4" cellspacing="0" bordercolor="#000" style="width: 100%">
          <tr>
            <th colspan="34">
              <div style="position: relative;text-align: center">
<!--                <img src="@/assets/reportIcon.png" width="100px" height="25px" style="position: absolute;left: 0px;top:-2px"/>-->
                <span>{{reportData.title}}</span>
                <span style="position: absolute;right: 0px;top:0px">{{ dateFormat(this.reportData.createTime,'YYYY-MM') }}</span>
              </div>
            </th>
          </tr>
          <tr>
            <td colspan="3">设备名称：{{ reportData.equipmentName }}</td>
            <td colspan="10">设备型号：{{ reportData.equipmentModel }}</td>
            <td colspan="10">购置日期：{{ reportData.datePurchase }}</td>
            <td colspan="11">资产编码：{{ reportData.documentNumber }}</td>
          </tr>
          <tr>
            <td>序号</td>
            <td>班前点检项目</td>
            <td>衡量标准</td>
            <td v-for="i in 31">{{ i }}</td>
          </tr>
          <tr v-for="(item,index) in reportData.dayCheckName" v-if="reportData.dayCheckName.length > 0">
            <td>{{index + 1}}</td>
            <td>{{item}}</td>
            <td>{{ reportData.dayDealMethords[index] }}</td>
            <td v-for="i in reportData.dayCheckList[index]">{{i.inspectionResults}}</td>
          </tr>
          <tr>
            <td>检查方法</td>
            <td>{{ reportData.inspectionMethod }}</td>
            <td></td>
            <td v-for="i in 31"></td>
          </tr>
          <tr>
            <td rowspan="2">检查周期</td>
            <td rowspan="2">{{ reportData.inspectionCycle }}</td>
            <td>点检人：</td>
            <td v-for="i in reportData.dayCheckList[0]">{{ i.maintainer }}</td>
          </tr>
          <tr>
            <td>稽查人：</td>
            <td v-for="i in reportData.dayCheckList[0]">{{i.reviewer}}</td>
          </tr>
          <tr>
            <td colspan="3">记入方式:{{reportData.accountingMethod}}</td>
            <td colspan="31">备注:{{reportData.beCareful}}</td>
          </tr>
        </table>
      </div>
    </a-card>
  </div>
</template>

<script>
import { dateFormat } from '@/utils/util'
export default {
  /** 设备班前点检表（贴片机、回流焊） **/
  name: 'ClassBeforEquipmentBehave',
  props:{
    reportData:{
      type:Object,
      default:()=>{}
    },
    type:{
      type:String,
      default:''
    }
  },
  data(){
    return {
      checkList:[
        {
          checkName:'检查总电源是否正常',
          measure:''
        },
        {
          checkName:'检查各指示灯是否正常',
          measure:''
        },
        {
          checkName:'检查安全标示是否完整',
          measure:'完好、无破损、模糊现象'
        },
        {
          checkName:'检查机器前后罩盖是否盖好',
          measure:''
        },
        {
          checkName:'检查气压是否在正常范围内',
          measure:'气压范围：0.4MPa-0.6MPa'
        },
        {
          checkName:'检查机器感应器是否遮挡',
          measure:'表面清洁、无异物、灰尘、杂物'
        },
        {
          checkName:'检查各轨道是否有杂物',
          measure:'无任何物品和障碍物、工具'
        },
        {
          checkName:'检查紧急开关是否正常',
          measure:'灵活、可靠、无松脱现象'
        },
        {
          checkName:'检查机器头部、吸嘴状态',
          measure:'头部真空阀有无漏气，吸嘴是否同一高度，有无堵孔、有无粘锡。'
        },
        {
          checkName:'检查机器内外是否清洁',
          measure:'轨道无杂物、灰尘、纸带、废料'
        },
        {
          checkName:'检查每个飞达是否平稳放在料站上，有无松脱现象。',
          measure:'清理料站上的杂物、纸带、废料。'
        },
        {
          checkName:'检查气动系统是否有漏气，过滤装置有无积水，是否正常工作，外置气阀否有破损迹象。',
          measure:'无漏气、无积水'
        },
      ]
    }
  },
  methods:{
    dateFormat,
  }
}
</script>

<style scoped>

</style>